﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:SeismicResponseSpectrum.Ui"
	xmlns:mui="http://firstfloorsoftware.com/ModernUI"
	mc:Ignorable="d"
	x:Class="SeismicResponseSpectrum.Ui.SeismicRecordControl"
	x:Name="UserControl"
	d:DesignWidth="207.431" d:DesignHeight="32.048">

	<UserControl.Resources>
		<local:ParametricVisibilityConverter x:Key="ParametricVisibilityConverter"/>
		<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<ControlTemplate x:Key="Tmpl1" TargetType="{x:Type CheckBox}">
			<Grid>
				
				<Image x:Name="onImg" Source="Images/eyeOn.png" Stretch="Uniform"  />

				<Image x:Name="offImg" Source="Images/eyeOff.png" Stretch="Uniform" />

			</Grid>
			
			<ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="onImg" Property="Visibility" Value="Collapsed" />
							<Setter TargetName="offImg" Property="Visibility" Value="Visible" />
                        </Trigger>

						 <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="onImg" Property="Visibility" Value="Visible" />
							<Setter TargetName="offImg" Property="Visibility" Value="Collapsed" />
							
                        </Trigger>
                    </ControlTemplate.Triggers>
		</ControlTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot" Margin="5">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="50"/>
			<ColumnDefinition Width="5"/>
			<ColumnDefinition />
			<ColumnDefinition Width="5"/>
			<ColumnDefinition Width="50"/>
		</Grid.ColumnDefinitions>
		<TextBlock x:Name="blkTitle" Text="{Binding Title, FallbackValue=testTESTtestTESTtestTESTtestTEST}" Grid.Column="2" MouseDown="TextBlock_MouseDown" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
		<CheckBox Grid.Column="6" x:Name="chkVisible" Content="CheckBox" IsChecked="{Binding IsVisible}" Template="{DynamicResource Tmpl1}" ToolTip="Show hide record" Cursor="Hand" Width="50" Height="22"  />
		<TextBox x:Name="txtTitle" Text="{Binding Title, Mode=TwoWay, UpdateSourceTrigger=Explicit}" Grid.Column="2" Margin="0" Visibility="{Binding IsInEditMode, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=UserControl}" KeyDown="txtTitle_KeyDown" LostFocus="txtTitle_LostFocus" d:IsHidden="True"/>
		<local:CustomColorPicker Margin="0" SelectedColor="{Binding Color}" ShowAdvancedButton="False" ShowDropDownButton="False"/>
	</Grid>
</UserControl>